<?=$this->render ( 'public/left.phtml' );?>
<div class="admin-right">
<div class="admin-menu">
<li><a href="/admin/site">小站列表</a></li>
<li><a href="/admin/site/site/do/create">创建小站</a></li>
</div>
<div class="clear"></div>

<div class="admin-menu1"><a href="/admin/site">小站列表</a><?php
if ($this->siteInfo ['site_name']) {
	?>><a
	href="/admin/site/model/site_id/<?=$this->siteInfo ['site_id']?>"><?=$this->siteInfo ['site_name']?></a><?
}
?><?php

if ($this->modelInfo ['model_name']) {
	?>><a
	href="/admin/site/<?=$this->modelInfo ['model_type']?>/model_id/<?=$this->modelInfo ['model_id']?>"><?=$this->modelInfo ['model_name']?></a><?
}
?></div>
 

  <?php
		if ($this->do == 'addModel') {
	?>
 <div class="admin-create">
<form id="model" name="form1" method="post"
	action="/admin/site/model/do/addModel">
<div class="title">&nbsp;为小站添加一个模块</div>
<table>
	<tr>
		<td>模块名称</td>
		<td><input type="text" name="model_name" id="model_name" class="input" /></td>
	</tr>
	<tr>
		<td>模块类型</td>
		<td><select name="model_type" id="model_type">
			<option value="0">请选择</option>
      <?php
	foreach ( $this->siteModel as $k => $v ) {
		?>
        <option value="<?=$k?>"><?=$v?></option>
     <?
	}
	?>   
      </select></td>
	</tr>
	<tr>
		<td>首页显示</td>
		<td><select name="show_index" id="model_show_index">
			<option value="0">不显示</option>
			<option value="5">显示5条</option>
			<option value="10">显示10条</option>
			<option value="20">显示20条</option>
		</select></td>
	</tr>
	<tr>
		<td>模块介绍</td>
		<td><textarea name="model_intro" id="model_intro" cols="45" rows="5"
			class="input1" maxH=0 ></textarea></td>
	</tr>
	<tr>
		<td>&nbsp;</td>
		<td><input type="submit" value="提 交" /> <input type="reset"
			name="button" id="button" value="重置" /> <input name="site_id"
			type="hidden" id="site_id" value="<?=$this->site_id?>" /></td>
	</tr>
</table>
</form>
</div>
<?
}
		elseif ($this->do == 'editModel') {
			?>
 <div class="admin-create">
<form id="model" name="form1" method="post"
	action="/admin/site/model/do/editModel">
<div class="title">&nbsp;编辑模块</div>
<table>
	<tr>
		<td>模块名称</td>
		<td><input type="text" name="model_name" id="model_name" class="input"
			value="<?=$this -> modelInfo ['model_name']?>" /></td>
	</tr>
	<tr>
		<td>模块类型</td>
		<td><select name="model_type" id="model_type">
        <?php
			foreach ( $this -> siteModel as $k => $v ) {
				?>
        <option value="<?=$k?>"
				<?
				if ($k == $this -> modelInfo ['model_type']) {
					?>
				selected="selected" <?
				}
				?>><?=$v?></option>
        <?
			}
			?>   
        </select></td>
	</tr>
	<tr>
		<td>首页显示</td>
		<td><select name="show_index" id="model_show_index">
			<option value="0">不显示</option>
			<option value="5"
				<?
			if (5 == $this -> modelInfo ['show_index']) {
				?>
				selected="selected" <?
			}
			?>>显示5条</option>
			<option value="10"
				<?
			if (10 == $this -> modelInfo ['show_index']) {
				?>
				selected="selected" <?
			}
			?>>显示10条</option>
			<option value="20"
				<?
			if (20 == $this -> modelInfo ['show_index']) {
				?>
				selected="selected" <?
			}
			?>>显示20条</option>
		</select></td>
	</tr>
	<tr>
		<td>模块介绍</td>
		<td><textarea name="model_intro" id="model_intro" cols="45" rows="5"
			class="input1" maxH=0 ><?=$this -> modelInfo ['model_intro']?></textarea></td>
	</tr>
	<tr>
		<td>&nbsp;</td>
		<td><input type="submit" value="编辑" /> <input type="reset"
			name="button" id="button" value="重置" /> <input name="model_id"
			type="hidden" id="model_id" value="<?=$this -> model_id?>" /></td>
	</tr>
</table>
</form>
</div>
<?
		}
		else {
			?> 
  <div class="title">模块列表 <span
	style="font-size: 12px; font-weight: normal;"><a
	href="/admin/site/model/site_id/<?=$this -> site_id?>/do/addModel">添加</a></span></div>

<div class="admin-list">
     <?php
			foreach ( $this -> modelList as $item ) {
				?>
      <p><a
	href="/admin/site/<?=$item ['model_type']?>/model_id/<?=$item ['model_id']?>"><?=$item ['model_name']?></a>[<b><?=$item ['model_type']?></b>]
<span class="admin-do"><a
	href="/admin/site/model/do/editModel/model_id/<?=$item ['model_id']?>">编辑</a>,删除</span></p>
	<?
			}
			?>
	</div>
<?
		}
		?>


</div>
<!-- end admin-right-->




